<!--
	作者：956911785@qq.com
	时间：2018-10-18
	描述：账号或密码修改-添加
-->

<template>
	<Modal title="查看" v-model="modal0" width="800px">
		<Form ref="params" :model="params" :label-width="100" label-position="left">
			<div style="width:100%;height:400px; overflow-y: scroll;">
	        	<div class="div-float" align="left">
			        <FormItem label="学校:">
			        	<label>{{params.CSNAME}}</label>
	        		</FormItem>
	        	</div>
	        	<div class="div-float" align="left">
			        <FormItem label="报名号:">
		        		<p>{{params.BMH}}</p>
        			</FormItem>
	        	</div>
	        	
	        	<div class="div-float" align="left">
			        <FormItem label="学生生日:">
			        	<p>{{params.BIRTH}}</p>
	        		</FormItem>
	        	</div>
	        	<div  class="div-float" align="left">
			        <FormItem label="性别:">
			        	<p>{{params.SEX}}</p>
	        		</FormItem>
	        	</div>
		        	
	        	<div class="div-float" align="left">
			        <FormItem label="学生姓名:">
			        	<p>{{params.SNAME}}</p>
	        		</FormItem>
	        	</div>
	        	<div class="div-float" align="left">
			        <FormItem label="身份证号:">
			        	<p>{{params.SFZH}}</p>
	        		</FormItem>
	        	</div>
	        	
	        	
	        	<div style="width: 100%;text-align: left;float: left;" align="left">
			        <div style="float:left;height:32px;line-height: 32px;">
				        <FormItem label="户籍所在地:" >
				        	<p>{{params.HJSZDT}}</p>
		        		</FormItem>
	        		</div> 
	        	</div>
	        	
	        	
	        	<div class="div-float" align="left">
			        <FormItem label="家长姓名:">
			        	<p>{{params.JZXM}}</p>
	        		</FormItem>
	        	</div>
	        	<div class="div-float" align="left">
			        <FormItem label="家长手机:">
			        	<p>{{params.JZSJ}}</p>
	        		</FormItem>
	        	</div>
	        	
	        	<div class="div-float" align="left">
			        <FormItem label="登记时间:">
			        	<p>{{params.BMSJ}}</p>
	        		</FormItem>
	        	</div>
	        	<div class="div-float" align="left">
			        <FormItem label="状态:">
			        	<p>{{params.SFBMCGT}}</p>
	        		</FormItem>
	        	</div>
	        	
	        	<div style="width: 100%;float: left;" align="left">
			        <FormItem label="相关证明材料:">
				        <template v-for="(item, index) in imgs">
					        <div style="float:left;margin-right: 10px;width: 100px;" @click="handleView(item)"> 
					            <img :src="item" style="width: 100px;height:auto;float:left;">
						    </div> 
					    </template>
					    <Modal title="浏览图片" v-model="visible">
					        <img :src="imgurl" v-if="visible" style="width: 100%">
					    </Modal>
	        		</FormItem>
	        	</div>
	        	
				<div class="div-float" align="left">
			        <FormItem label="初审:">
			        	<Select v-model="ccsh" style="width:200px" clearable>
					        <Option value="1" >审核成功</Option>
					        <Option value="2" >初次审核失败</Option>
					    </Select>
	        		</FormItem>
	        	</div>	
	        	<div class="div-float" align="left">	
	        		<FormItem label="审核失败的原因:">
			        	<Select v-model="sbyy" style="width:200px" clearable>
					        <Option value="户口不在招生范围内，不能参与摇号" >户口不在招生范围内，不能参与摇号</Option>
					        <Option value="户口信息不详，请重新上传" >户口信息不详，请重新上传</Option>
					        <Option value="没上传户口本图片信息" >没上传户口本图片信息</Option>
					        <Option value="已取得其他幼儿园招生资格，不属于招生范围" >已取得其他幼儿园招生资格，不属于招生范围</Option>
					    </Select>
	        		</FormItem>
	        	</div>

		   </div> 
	    </Form>
	   	<div slot="footer">
	    	<Button type="text"  @click="closeModal()">取消</Button>
	    	<Button type="primary" @click="ccshsave()" >确定</Button>
	    </div>
     </Modal>
</template>

<script>
	import _config from "../../../../../config/config";
	export default {
		name:"tconent",
		props: {
    		params:{
    			type:Object,	
    			default: function() {
					return null
				}
    		},
    	},
		data() {
			
			return {
				modal0:false,
				visible:false,
				imgs:[],
				imgurl:'',
				ccsh:'',
				sbyy:'',
			}
		},
		components: {
		},
		methods: {
			closeModal(){
				this.modal0= false;
			},
 
			handleView (imageurl) {
                this.visible = true;
                this.imgurl=imageurl;
            },
            
            ccshsave:function(){
				if(this.ccsh==""){
					this.$Modal.error({
                        title: "失败",
                        content: "请选择初审是否成功！"
                    });
                    return;
				}
				
				if(this.ccsh=="2"){
					if(this.sbyy==""){
						this.$Modal.error({
	                        title: "失败",
	                        content: "请选择初审失败的原因！"
	                    });
	                    return;
					}	
				}else{
					this.sbyy="";
				}
				
				var sid=this.params.SID;
				var ccsh=this.ccsh;
				var sbyy=this.sbyy;
				const params={
            		sid:sid,
            		ccsh:ccsh,
            		sbyy:sbyy,
            	}
            	//保存
				this.$http.post("/host/bmxt/student/ccsh_Student.html",params)
				.then(result => {
					if(result){
						this.$Modal.success({
                            title: "成功",
                            content: "提交成功！",
                            onOk: () => {
                            	this.modal0 = false;
					    		this.$emit("reload");
                            }
                       });
					}else{
						this.$Modal.error({
                            title: "失败",
                            content: "修改失败！"
                        });	
					}
				});	
	        }, 
			
	        
		},
		computed: {
		},
		mounted() {
		
  			
		},
		watch:{
			modal0(news,olds){
				if(news){	
					this.imgs=[];
					var imgurls=this.params.imgurls;
					var imgs=[];
					for(var i=0;i<imgurls.length;i++){
						imgs.push(_config._ADMIN_SERVER+"/bmxt/"+imgurls[i].IMAGEURL);
					}
					this.imgs=imgs;	
					this.ccsh=this.params.CCSH;
					this.sbyy=this.params.SBYY;
				}else{
					this.imgs=[];
					this.ccsh="";
					this.sbyy="";
				}
			}
		},
	}
</script>

<style scoped="scoped">
	.div-float{
		width: 50%;
		text-align: left;
		float: left;
		height: 32px;
		line-height: 32px;
	}
</style>



